package monitor

import (
	"fmt"
	"gitee.com/crack007/goose"
	"github.com/crack007/go-im/src/common/config"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	"net/http"
)

func NewPrometheus() {
	port := config.GetPrometheusPort()
	goose.GetLogger().Info("Prometheus start-> %d", port)
	serveMux := http.NewServeMux()
	serveMux.Handle("/metrics", promhttp.Handler())
	goose.GetLogger().Error(http.ListenAndServe(fmt.Sprintf(":%d", port), serveMux).Error())

}
